package com.ysd.lis.controller.qi;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.qi.QiIndexCond;
import com.ysd.lis.service.qi.QiIndexCondService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 指标项目条件表 前端控制器
 * </p>
 *
 * @author LiuQi
 * @since 2024-02-05
 */
@Api(tags = "指标项目条件")
@RestController
@RequestMapping("/api/qi/indexCond")
public class QiIndexCondController extends BaseController {

    @Autowired
    QiIndexCondService qiIndexCondService;

    @ApiOperation("获取指标项目条件信息")
    @GetMapping("/getIndexConditionList/{indexItemId}")
    public Result getIndexConditionList(@PathVariable("indexItemId") String indexItemId) {
        return qiIndexCondService.getIndexConditionList(indexItemId);
    }

    @ApiOperation("添加指标项目条件信息")
    @PostMapping("/addQiIndexConditions")
    public Result addQiIndexConditions(@RequestBody List<QiIndexCond> qiIndexConds) {
        return qiIndexCondService.addQiIndexCondition(qiIndexConds);
    }

    @ApiOperation("编辑指标项目条件信息")
    @PostMapping("/updateQiIndexCondition")
    public Result updateQiIndexCondition(@RequestBody List<QiIndexCond> qiIndexConds) {
        return qiIndexCondService.updateQiIndexCondition(qiIndexConds);
    }

    @ApiOperation("删除指标项目条件信息")
    @PostMapping("/deleteQiIndexCondition")
    public Result deleteQiIndexCondition(@RequestBody QiIndexCond qiIndexCond) {
        return qiIndexCondService.deleteQiIndexCondition(qiIndexCond);
    }
}
